#
# ```Analysis.R```
#
# Master R file to create the tables for 
#   Ban, Pamela and Seth J. Hill. "Efficacy of Congressional Oversight." American Political Science Review.
#

rm( list=ls() )
# Libraries.
library(bit64)
library(data.table)
library(haven)
library(Hmisc)
library(RColorBrewer); palette(brewer.pal(n=9,name="Set1")[c(1:5,7:9)])
options(digits=2)


# Parameters for run.
# Working directory.
setwd(".")
# Location of data files.
DATALOC = "../data"
# Output for figures.
FIGURELOC = "../figures"
# Output for tables.
TABLELOC = "../tables"



#
# ==============
# Table 1: Summary of hearings, witnesses, agencies, and programs
# by fiscal year.
# ==============
#
source("Table01.R")

#
# ==============
# Figure 1: IP rates and amounts by agency by year for top 10 outlay agencies.
# ==============
#
source("Figure01.R")

#
# ==============
# Figure 2: Improper payment rate trends and model fixed effect estimates by fiscal year.
# ==============
#
source("Figure02.R")

#
# ==============
# Figure A1: Parallel trends Pre-post plot. Relate incidence of
# hearing to trend of program IP rates.
# ==============
#
source("FigureA01.R")

#
# ==============
# Figure A2: Most improved IP rate programs.
# ==============
#
source("FigureA02.R")